home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / amos / amoslist-1294.lzh / AMOSLIST / text0124.txt < prev    next >
Encoding:
Text File  |  1995-01-03  |  1.2 KB  |  30 lines

  1. >For my particle engine, I'd like to add the ability for a user to load a
  2. >2-colour IFF of any size.  Then, the program would randomly (or
  3. >not-so-randomly) set the particle positions where the pixels of the IFF are
  4. >not set to colour 0 (Black).
  5. >
  6. >1) Can I do it?
  7. >2) Can I get from a file the resolution of an IFF, colour depth, etc.
  8. >3) How do I read the IFF into the computer if the resolution is greater
  9. >than the displayable screen (one pixel at a time)?
  10.  
  11.   Yes, yes, and not easily; but there's a simple way to do it that doesn't
  12. require knowing the IFF format.  Load the picture like this:
  13.  
  14. Auto View Off : Rem So the user doesn't see the picture
  15. Load Iff PICTURE_FILE$,7 : Rem Load the picture into screen 7
  16. Screen Hide 7 : Rem So the screen doesn't show up later
  17. Auto View On: Rem Restore normal screen operation
  18.  
  19.   Now you have an invisible screen with the picture on it.  You can use the
  20. Screen Width, Screen Height etc. commands to find out the screen geometry,
  21. and open another screen with the same values.  Then all you have to do is
  22.  
  23. Screen 7 : P=Point(X,Y) : Screen 0 : Plot X,Y,P
  24.  
  25.   Admittedly, this is not fast, but it's about all you're going to get out
  26. of AMOS.
  27.  
  28.   --Andy Church
  29.  
  30.